export default {
  getAnchors() {
    return this.anchors.slice();
  },

  getAnchorsByIndex(index) {
    return this.anchors.find((item) => item.index === index);
  },

  active() {
    this.selected = true;
    this.attr({
      style: {
        shadowColor: "yellow",
        shadowBlur: 3,
      },
    });
  },

  unactive() {
    this.selected = false;
    this.attr({
      style: {
        shadowColor: "",
        shadowBlur: 0,
      },
    });
  },

  refreshEdge() {
    this.createAnchors();
    this.anchor?.refresh();
    this.__zr && this.__zr.trigger("refreshEdge", { node: this });
  },
};
